package com.apes.autoparts.autoCode.repository;

import com.alibaba.fastjson.JSONArray;
import com.apes.autoparts.autoCode.model.EpcOePjmc;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

/**
 * @Title: EpcOePjmcRepository
 * @Author fj
 * @Package com.apes.autoparts.autoCode.repository
 * @Date 2023/6/8 17:24
 * @description: OE号译码库数据层
 */
public interface EpcOePjmcRepository extends CustomRepository<EpcOePjmc, String> {

    @Query(value = "select * from EPC_OE_PJMC A where A.PARTNUMBER in (:oes) AND A.PJMC IS NOT NULL AND REGEXP_LIKE(A.EPC_BBMC, :epc, 'i')",nativeQuery = true)
    List<Map> queryByOes(JSONArray oes, String epc);

}
